import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)

const routes = [
  // {
  //   path: '/about',
  //   name: 'About',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  // }
  {
    path: '/',
    component: () => import(/* webpackChunkName: "about" */ '../views/Home.vue'),
    children: [{
      path: '/detail/:id',
      name: 'Detail',
      component: () => import(/* webpackChunkName: "about" */ '../views/Detail.vue')
    }, {
      path: '/',
      name: 'Index',
      component: () => import(/* webpackChunkName: "about" */ '../views/Index.vue')
    }, {
      path: '/bookmarks',
      name: 'BookMarks',
      component: () => import(/* webpackChunkName: "about" */ '../views/BookMarks.vue')
    }, {
      path: '/user/:id',
      name: 'User',
      component: () => import(/* webpackChunkName: "about" */ '../views/User.vue')
    }]
  }, {
    path: '/Login',
    name: 'Login',
    component: () => import(/* webpackChunkName: "about" */ '../views/Login.vue')
  }, {
    path: '/message/:msg',
    name: 'Message',
    component: () => import(/* webpackChunkName: "about" */ '../views/Message.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router
